const gchar *envvar;
GdkScreen *screen;
GtkSettings *settings;
-
+
if (!contexts_hash)
gtk_im_module_initialize ();
- envvar = g_getenv("GTK_IM_MODULE");
+ envvar = g_getenv ("GTK_IM_MODULE");
if (envvar)
{
- immodules = g_strsplit(envvar, ":", 0);
- context_id = lookup_immodule(immodules);
- g_strfreev(immodules);
+ immodules = g_strsplit (envvar, ":", 0);
+ context_id = lookup_immodule (immodules);
+ g_strfreev (immodules);
if (context_id)
return context_id;
/* Check if the certain immodule is set in XSETTINGS.
*/
- if (GDK_IS_WINDOW (client_window))
+ screen = gdk_screen_get_default ();
+ settings = gtk_settings_get_for_screen (screen);
+ g_object_get (G_OBJECT (settings), "gtk-im-module", &tmp, NULL);
+ if (tmp)
{
- screen = gdk_window_get_screen (client_window);
- settings = gtk_settings_get_for_screen (screen);
- g_object_get (G_OBJECT (settings), "gtk-im-module", &tmp, NULL);
- if (tmp)
- {
- immodules = g_strsplit(tmp, ":", 0);
- context_id = lookup_immodule(immodules);
- g_strfreev(immodules);
- g_free (tmp);
-
- if (context_id)
- return context_id;
- }
+ immodules = g_strsplit (tmp, ":", 0);
+ context_id = lookup_immodule (immodules);
+ g_strfreev (immodules);
+ g_free (tmp);
+
+ if (context_id)
+ return context_id;
}
/* Strip the locale code down to the essentials
tmp = strchr (tmp_locale, '@');
if (tmp)
*tmp = '\0';
-
+
tmp_list = modules_list;
while (tmp_list)
{
GtkIMModule *module = tmp_list->data;
-
+
for (i = 0; i < module->n_contexts; i++)
{
const gchar *p = module->contexts[i]->default_locales;
p = q ? q + 1 : NULL;
}
}
-
+
tmp_list = tmp_list->next;
}
g_free (tmp_locale);
-
+
return context_id ? context_id : SIMPLE_ID;
}